/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package converter.model;

import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Column;

/**
 *
 * @author reverende
 */
@Entity
public class Currency implements CurrencyDTO, Serializable {
    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private int currencyID;

    public int getCurrencyID() {
        return currencyID;
    }
    private String currencyName;
    private double exchangeRate;

    
    public Currency(){
    }
    
    public Currency(String currencyName, double exchangeRate){
        this.currencyName = currencyName;
        this.exchangeRate = exchangeRate;
    }
    
    @Override
    public String getName() {
        return currencyName;
    }

    public void setName(String currencyName) {
        this.currencyName = currencyName;
    }
    
    @Override
    public double getExchangeRate(){
        return exchangeRate;
    }
    
    public void setExchangeRate(double exchangeRate){
        this.exchangeRate = exchangeRate;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (currencyName != null ? currencyName.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Currency)) {
            return false;
        }
        Currency other = (Currency) object;
        if ((this.currencyName == null && other.currencyName != null) || (this.currencyName != null && !this.currencyName.equals(other.currencyName))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return currencyName;
    }

    
    
}